package com.zpark.resume.controller.exception;

import com.zpark.resume.common.ResponseResult;
import com.zpark.resume.common.StatusCode;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @PackageName: com.zpark.resume.controller.exception
 * @ClassName: ExceptionHandlerException
 * @Description: 全局统一异常处理
 * @author: RZS
 * @date: 2023/5/30  16:41
 */
@ResponseBody
@ControllerAdvice
public class ExceptionHandlerException {

    @ExceptionHandler
    public ResponseResult<Void> handler(Exception e){
        return new ResponseResult<>(StatusCode.UNKONWN.getCode(), e.getMessage(), null);
    }
}
